using SmartPeople.Framework.SecuritySpace;

namespace SmartPeople.Framework.SecuritySpace
{
    public sealed class SecurityApplications : ISecurityApplicationProvider
    {
        private ISecurityApplicationProvider provider;


        public SecurityApplications(ISecurityApplicationProvider provider)
        {
            this.provider = provider;
        }


        private ISecurityApplicationProvider Provider
        {
            get { return provider; }
            set { provider = value; }
        }

        #region CreateApplication

        public ISecurityApplication CreateApplication(string securityApplicationName, string description)
        {
            return Provider.CreateApplication(securityApplicationName, description);
        }

        #endregion

        #region GetAllApplications

        public ISecurityApplication[] GetAllApplications()
        {
            return Provider.GetAllApplications();
        }

        #endregion

        #region GetApplication

        public ISecurityApplication GetApplication(string securityApplicationName)
        {
            return Provider.GetApplication(securityApplicationName);
        }

        #endregion

        #region UpdateApplication

        public void UpdateApplication(ISecurityApplication securityApplicationName)
        {
            Provider.UpdateApplication(securityApplicationName);
        }

        #endregion

        #region ApplicationExists

        public bool ApplicationExists(string securityApplicationName)
        {
            return Provider.ApplicationExists(securityApplicationName);
        }

        #endregion

        #region DeleteApplication

        public bool DeleteApplication(string securityApplicationName)
        {
            return Provider.DeleteApplication(securityApplicationName);
        }

        #endregion

        #region DeleteApplication

        public bool DeleteApplication(string securityApplicationName, bool throwOnPopulatedRole)
        {
            return Provider.DeleteApplication(securityApplicationName, throwOnPopulatedRole);
        }

        #endregion

        #region Clear

        public void Clear()
        {
            Provider.Clear();
        }

        #endregion
    }
}